package com.ibm.cloud.banking.constant;

/**
 * 交易错误信息管理，由错误码和错误描述信息组成，错误码固定长度为4位
 */
public enum TransErrorMgt {

    //交易错误码管理，错误码固定长度为4位<br>
    //第一位：1 客户领域；2 账户领域；3 产品领域；4 介质领域 ；9 公共<br>
    //公共参数：91XX 第二位 1 输入参数；2 数据实体操作

    // 公共异常->输入参数类型异常
    PARAM_VALUE_IS_NULL("9101","参数【%s】值为空"),
    PARAM_VALUE_OVER_LENGTH("9102","参数【%s】值【%】超过【%】长度"),
    PARAM_TYPE_ERROR("9103","参数【%s】值数据类型错误"),
    PARAM_VALUE_ERROR("9104","参数【%s】值超出系统定义范围【%】"),
    PARAM_VALUE_RANGE_ERROR("9105","交易金额必须大于0"),

    // 公共异常->数据实体操作类异常
    ENTITY_NOT_EXIST("9201","【%s】不存在"),
    ENTITY_IS_EXIST("9202","【%s】已经存在"),

    // 1 客户领域异常码定义customer_certificate
    CUSTOMER_NO_NOT_MATCH_CERTIFICATE("1001","客户证件与客户编号不匹配"),
    CUSTOMER_CERTIFICATE_IS_EXIST("1002","该证件已经存在，客户号为【%s】"),

    // 2 账户领域异常码定义
    CUSTOMER_MAX_ACCOUNT_COUNT("2001","该客户开立的同类账户已达上限"),
    ACCOUNT_STATUS_NOT_NORMAL("2002","转出账户状态不正常"),
    ACCOUNT_NOT_ALLOW_PAYMENT("2003","转出账户不可支付"),
    ACCOUNT_BALANCE_INSUFFICIENT("2004","转出账户可用余额不足"),
    ACCOUNT_NOT_ALLOW_DEPOSIT("2005","转入账户不可存入"),
    DEPOSIT_ACCOUNT_NAME_NOT_MATCH("2005","转入账户户名不符"),
    DAY_WITHDRAW_LIMIT_AMT("2006","转出金额超出账户每日限额：%s，当日剩余可以转金额：%s"),


    // 5 内部账领域异常码定义
    BRACCOUNT_OVER_DRAW("5001","账户已透支"),
    BRACCOUNT_DR_CR_ERR("5002","损益账户发生方向与余额方向不一致"),
    BRACCOUNT_ACCT_IS_EXIST("5003","开户账户已存在"),
    BRACCOUNT_ACCT_NOT_EXIST("5004","账户不存在"),
    BRACCOUNT_TEMPACCT_NOT_EXIST("5005","模板账户不存在"),
    BRACCOUNT_TEMPACCT_IS_CLOSE("5006","模板账户已销户"),
    BRACCOUNT_ACOUNTING_SUB_NOT_EXIST("5007","【%s】科目未定义"),
    BRACCOUNT_ACOUNTING_STRSEQ_ERR("5008","非标准账号序号起始号非法"),
    BRACCOUNT_ACOUNTING_SUB_NOT_USED("5009","科目不再使用"),
    BRACCOUNT_ACOUNTING_SUB_UNAVB("5010","科目无效"),
    BRACCOUNT_ACOUNTING_SUB_UN_DETAIL("5011","不是最明细科目"),

    // 3 产品领域
    PRODUCT_NOT_ALLOW_SALES("3001","产品状态不用"),
    PRODUCT_MAX_VAL_OUT("3002","开户金额超出产品最大开户金额"),
    PRODUCT_MIN_VAL_OUT("3003","开户金额低于产品最小开户金额"),
    PRODUCT_ACC_NOT_MATCH("3004","账户类型与产品不符"),

    // 4 介质领域
    MEDIA_CARD_ALLOCATED("4001","卡片状态不正确"),
    MEDIA_NOT_MAIN_CARD("4002","该卡片不是主卡"),
    MEDIA_STATUS_EXCEPTION("4003","输入的卡片状态异常"),
    MEDIA_CARD_PASSWORD_ERROR("4004","卡密码不正确"),

    // 6 总账领域异常码定义
    GENERALLEDGER_TXTYP_ERROR("6001","交易方式错误"),
    GENERALLEDGER_INPUT_NULL("6002","输入项为空"),
    ;

    public String code;
    public String message;

    TransErrorMgt(String code, String message){
        this.code = code;
        this.message = message;
    }


}